import 'dart:async';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_base/base/base_model.dart';
import 'package:flutter_base/base/base_stateless_widget.dart';
import 'package:flutter_base/test_model.dart';
import 'package:flutter_base/widget/swiper_widget.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePageState(),
    );
  }
}

List<String> test = [
  "qwew",
  "asda",
  "zvxc",
  "data",
  "asdas",
  "asdaswqeq",
  "fd" "grdg",
  "wtew",
  "dxcv",
  "qwew",
  "asda",
  "zvxc",
  "data",
  "asdas",
  "asdaswqeq",
  "fd" "grdg",
  "wtew",
  "dxcv",
  "qwew",
  "asda",
  "zvxc",
  "data",
  "asdas",
  "asdaswqeq",
  "fd" "grdg",
  "wtew",
  "dxcv",
  "qwew",
  "asda",
  "zvxc",
  "wtew",
  "dxcv",
  "qwew",
  "asda",
  "zvxc",
  "data",
  "asdas",
  "asdaswqeq",
  "fd" "grdg",
  "wtew",
  "dxcv",
  "qwew",
  "asda",
  "zvxc"
];
List<String> test2 = [
  "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F00881H1cly1gqy777f5i3j31hc0u0wh3.jpg&refer=http%3A%2F%2Fwx4.sinaimg.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1627205127&t=0abd189122e28fbf4e1033bcf3bc316a",
  "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F792f44ecly1gravtkykofj21hc0u0mz6.jpg&refer=http%3A%2F%2Fwx1.sinaimg.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1627205127&t=f860a8e4c61f9f418403a5b1553903c0",
  "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn20110%2F600%2Fw1920h1080%2F20190420%2F287f-hvvuiyn3095532.jpg&refer=http%3A%2F%2Fn.sinaimg.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1627205127&t=00e98d4023d4831af6850c8e60e7f9c1"
];

class MyHomePageState extends BaseStateLessWidget<TestModel> {
  @override
  void beforeBuild(BuildContext context) {}

  // @override
  // Widget title() =>Text("初始化");

  @override
  Widget content(TestModel model) => SingleChildScrollView(
        child: Column(

          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(width: double.infinity,),
            SwiperWidget(
              width: 320.0,
              height: 180.0,
              getUrl: (i) {
                return test2[i];
              },
              marginBottom: 5,
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(10))),
              size: test2.length,
            ),
            FlatButton(onPressed: (){}, child: Container(width: 160,height: 90,color: Colors.red,))
          ],
        ),
      );

  @override
  TestModel createModel() => TestModel();

  @override
  bool hasAppBra() => false;
}
